<?php

namespace frontend\modules\shop\models;

use Yii;
use common\helpers\Url;

/**
 * 标准化产品单元数据模型（SPU）
 * 
 * @author emhome<emhome@163.com>
 * @since 2.0
 */
class StandardProductUnit extends \common\models\shop\ShopProduct {

    /**
     * {@inheritdoc}
     */
    public function fields() {
        return [
            'id',
            'name',
            'picture' => function() {
                return Url::attach($this->cover);
            },
            'price',
            'origin' => function() {
                return '';
            },
            'slogan',
            'description',
            'express' => function() {
                return true;
            },
            'content' => 'detail',
            'album',
            'sales',
        ];
    }

}
